﻿HISTORYPATH = [
    {"id" : 0, "url" : "", "caption" : "Главная", },
    {"id" : 1, "url" : "", "caption" : "Новая категория", },
    {"id" : 2, "url" : "", "caption" : "Новая запчасть", },
]



def sethistorypath(request, history_id):
    hp = request.session["history_path"]
    if history_id in hp:
        request.session["history_path"] = hp[:(hp.index(history_id)+1)]
    else:
        request.session["history_path"].append(history_id)
    return 1 

